<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="root">
    <h1>{{info}}</h1>
    <button @click="handleClick">按钮</button>
</div>
<script>
    Vue.config.productionTip = false;
    new Vue({
        el: "#root",
        data: {
            info: 0
        },
        watch: {
            info(newValue, oldValue){
                console.log(newValue, oldValue);
            }
        },
        methods: {
            handleClick() {
                this.info++;
            }
        }
    })
</script>
</body>
</html>
